package com.example.demo.controller.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: WinstonDeng
 * @Description:
 * @Date: Created in 18:58 2020/4/9
 * @Modified by:
 */
public class CommitQuestionnaireDTO {
    private Long flowStepId;
    private List<SelectItem> selectItemList;

    public CommitQuestionnaireDTO (){
    }

    public List<SelectItem> getSelectItemList() {
        return selectItemList;
    }

    public void setSelectItemList(List<SelectItem> selectItemList) {
        this.selectItemList = selectItemList;
    }

    public Long getFlowStepId() {
        return flowStepId;
    }

    public void setFlowStepId(Long flowStepId) {
        this.flowStepId = flowStepId;
    }

    @Override
    public String toString() {
        return "CommitQuestionnaireDTO{" +
                "flowStepId=" + flowStepId +
                ", selectItemList=" + selectItemList +
                '}';
    }

    public List<Long> getQustionIdList(){
        List<Long> questionIdList = new ArrayList<Long>();
        for(SelectItem selectItem:this.selectItemList){
            questionIdList.add(selectItem.getQuestionId());
        }
        return questionIdList;
    }

    public List<String> getAnswerList(){
        List<String> answerList = new ArrayList<String>();
        for(SelectItem selectItem:this.selectItemList){
            answerList.add(selectItem.getAnswer());
        }
        return answerList;
    }
}
